Release 10.1A: OpenEdge Development:
Programming Interfaces
Adding XML data to a populated temp-table
If you need to merge data in a 4GL temp-table with XML data, you can control the way in which Progress handles duplicate unique key conflicts with the
read-modeparameter. In this example, a new temp-table is set up with definition from theCustomertable and two new records. This set-up code is stored in an include file. Note that the first record uses a customer number that conflicts with one in the XML document. The second record has no conflict with the XML document:
Shown below is an abbreviated copy of the
ttCust.xmlfile.
To illustrate the different results obtained with each
read-modeoption, there is a unique index defined for theCustNumfield. There is a record in both the include file and the XML file that uses the sameCustNumvalue (1). This is known as a duplicate unique key conflict. The different read modes respond to such a conflict in different ways.The code sample below performs the same
READ-XML( )method call you saw in the last example. Replace the highlighted variable value in the code with each of the four read mode tokens and compare the results:
EMPTYAPPENDMERGEREPLACE
Compare your results to those shown and explained in Table 22–6.
Note: To see a version of the last example that uses a dynamic temp-table, look at the following sample files: pi-tfx-ttSetup-6.i and pi-tfx-read-6.p
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |